#ifndef __VAD_APP_H_
#define __VAD_APP_H_
#include <os/os.h>

#define VAD_INPUT_BUFF_NUM 6

enum
{
	CMD_VAD_START = 1,
	CMD_VAD_DATA,
	CMD_VAD_CANCEL,
	CMD_VAD_FLAG_CLEAR,
};

enum
{
	FLAG_VAD_NONE = 0,
	FLAG_VAD_START,
	FLAG_VAD_END
};

typedef enum
{
    VAD_STATE_IDLE = 0,
    VAD_STATE_WORKING,
}VAD_WORK_STATE;

typedef struct
{
	uint16_t cmd;
	uint16_t data_len;
	uint8_t *data_buf;
}VAD_MSG_ST,*VAD_MSG_PTR;

int vad_app_init(void);

uint8_t get_vad_work_status(void);
uint8_t get_vad_flag(void);
uint8_t get_vad_silence_flag(void);
void clear_vad_silence_flag(void);

void set_mic_param(int sample_rate, int channel);
void set_vad_threshold(int start_threshold_ms, int end_threshold_ms, int silence_threshold_ms);
bk_err_t vad_task_send_msg(uint16_t cmd, uint8_t* buf, uint16_t data_len);

#endif
